package next_flag_search;

import env.Action;
import java.util.LinkedList;

/**
 *
 * @author user
 */
public class DFS extends Search {

    @Override
    public LinkedList<Action> search() {
        MyQueue q=new MyQueue(){
            LinkedList<Node> queue = new LinkedList<Node>();
            public Node poll() {
                return queue.removeFirst();
            }

            public void add(Node n) {
                queue.addFirst(n); //<------------------------ only diff from BFS
            }

            public boolean isEmpty() {
                return queue.isEmpty();
            }
            
        };
        
        return super.graphSearch(q);
    }
}
